import Vue from 'vue';
import Vuex from 'vuex';
Vue.use(Vuex);

const store = new Vuex.Store({
	state: {
		isAlreadyLogin: false,
		openId: "",
		autor: undefined,
	},
	mutations: {
		saveOpenId(state, openId) {
			state.openId = openId;
		},
		loginSuccess(state, autor) {
			state.isAlreadyLogin = true;
			state.autor = autor;
		},
		loginOut(state) {
			state.isAlreadyLogin = false;
			state.autor = undefined;
		}
	}
});
export default store;